<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<link href="<%=basePath%>/themes/css/ui.common.css" rel="stylesheet"
			type="text/css" />
		<link href="<%=basePath%>/themes/css/ui.child.css" rel="stylesheet"
			type="text/css" />
		<link href="<%=basePath%>/themes/css/ui.tips.css" rel="stylesheet"
			type="text/css" />
		<link href="<%=basePath%>/style/jquery_ui/jquery-ui-1.8.custom.css"
			rel="stylesheet" type="text/css" />
		<link id="skin_css" rel="stylesheet" type="text/css"
			href="<%=basePath%>/themes/css/ui.c.blue.css"></link>
		<link rel="stylesheet"
			href="<%=basePath%>/themes/default/pagination.css" type="text/css"></link>
		<script src="<%=basePath%>/Scripts/jquery-1.4.1.min.js"
			type="text/javascript"></script>
		<script type="text/javascript"
			src="<%=basePath%>/Scripts/jquery.json-2.2.min.js"></script>

		<script src="<%=basePath%>/Scripts/jquery-ui-1.8.custom.min.js"
			type="text/javascript"></script>
		<script src="<%=basePath%>/Scripts/ui.admincp.js"
			type="text/javascript" charset="UTF-8"></script>
		<script type="text/javascript"
			src="<%=basePath%>/Scripts/ui.dialogFormHelper.js"></script>
		<STYLE type="text/css">
.editorArea {
	display: none;
}
tr{margin-bottom:10px;}
</STYLE>
		<script type="text/javascript">
				$(function(){
			
			
			$("#dialog").dialog("destroy"); 
			$("#dialog-form").dialog({
			autoOpen: false,
			height: 300,
			width: 460,
			modal: true,
			buttons: {
				Cancel: function() {
					$(this).dialog('close');
				}
			},
			close: function() {
				//allFields.val('').removeClass('ui-state-error');
			}
			});
			
			$('#TestButton')
			.click(function() { 
			    
			    //success:function(data){
			     $('#dialog-form').dialog('open');
			    //});
			
				
			});
			    
		    });
			</script>

		<SCRIPT type="text/javascript">
			var searching = false;
				$(function(){
					$("#link_page_prev,#link_page_next").click(function(){
			    		var currentPage = $(this).attr("currentPage");
			    	 
			    		goToPage(currentPage);
			    	}); 
			    	
			    	$("#searchButton").click(function(){
						searching=true;
			    		goToPage(1);
			    	});
			    	
			    	initSearch();
			    	registeRowFuncButton();
				});
				
				function initSearch()
				{
				    $("#txt_noticeTitle").val();
				}
			 
				function goToPage(currentPage)
				{
				    var title = $("#txt_noticeTitle").val();
				    var place =$("#txt_noticePlace").val();  
					location.href = "notice!deletePage.action?currpage="+currentPage+"&noticeTitle="+title 
							+ "&noticePlace="+place;
				}  
			//columns 为 列表中 点击了 查看详情按钮之后对应的那行的数据.
				//用 [i] 访问每列的 值 ,注意 i 的值和列的对应问题 以及注意: 使用类似 $(columns[i]).text() 访问 列中的文本.
				// 参数 e 包含两个属性:
				//			data ---> 所单击行的数据(一个数组)
				//			entityId ---> 对应 对象的 ID
	        function toShowDetailHandler(e) {  
			try	{	var columns = e.data;
				var noticeId = e.entityId;
			
				$.post("notice!queryDetail.action?query_id="+noticeId,null,function(data){
				var jsonClientObject = eval(data);
				var noticeInfo = jsonClientObject.noticeInfo;		
				var noticeSection = jsonClientObject.noticeSectionNames;
				var noticeStaff = jsonClientObject.noticeStaffNames;
		
				$("#dialog-content").html(noticeInfo.content);
				$("#dialog-postScript").html(noticeInfo.postScript);
				$("#dialog-sectionNames").html(noticeSection);
				$("#dialog-staffNames").val(noticeStaff);
				$('#dialog-form').dialog('open');
			
				
				},"json");
				}catch(e)
				{
				 alert(e);
				}
				
				
			}
							function checkAll(str)
				{
　 					var items = document.getElementsByName(str);　 //获取所有复选框
　					var totalNum = items.length;　 //获取复选框的个数
　 					for (var i=0; i<totalNum; i++)
　 					items[i].checked = window.event.srcElement.checked;//通过单击的按钮判断是选中还是未选
				}
				
				function deleteAll(str)
				{
					var isTo = checkDeleteAll("会议记录");

					if(isTo==false)
  					return ;
　 					var items = document.getElementsByName(str);　 //获取所有复选框
　					var totalNum = items.length;　 //获取复选框的个数
					var delStr = "";
　 					for (var i=0; i<totalNum; i++){
　 						if(items[i].checked == true){
							delStr += items[i].value + ","; 
						}
					}
					delStr = delStr.substring(0, delStr.length -1);
					
					location.href= "notice!deleteMore.action?noticeIds="+delStr+"&currpage="+${currpage};
				}	
			</SCRIPT>

	<script type="text/javascript" src="../../Scripts/ui.clientDateHelper.js"></script></head>

	<body>
 <div class="PageChild_Title">
        <img src=" themes/images/default/icons/archives.png" class="PageChild_Tbtnpic" />
        <span class="PageChild_separate"></span><span class="PageChild_TbtnText">
        <h2>
       	删除会议通知
        </h2>
        </span><span class="PageChild_separate"></span>
        <div id="marker" class="red-tips">
        </div>
        <div class="clear">
        </div>
    </div>
		<div class="PageChild_Where">
			<table style="height:60px" border="0" cellpadding="0"
				cellspacing="0">
					<tr>
					<td class="mtd">
						&nbsp;地点:<s:textfield name="noticePlace" maxlength="20"
							id="txt_noticePlace" theme="simple" />
					</td>
					<td  class="mtd">
						&nbsp;标题:<s:textfield name="noticeTitle" maxlength="20"
							id="txt_noticeTitle" theme="simple" />
					</td>
					<td>
						<input type="submit" name="searchButton" class="o-btn SubmitButton" value="搜索"
							id="searchButton" />
					</td>
					</tr>
					<tr>
					<td colspan="5">
						&nbsp;<span id="lbl_list_count">由您发起还有 <b>${count}</b> 个会议尚未进行。</span>
					</td>
				</tr>
			</table>
		</div>
		<div class="PageChild_List">
			<table width="100%" border="0" cellspacing="0"
				style="text-align: left">
				<tbody class="PageChild_List_head">
					<tr>
						<td width="16">
							<input id="Chk_All" type="checkbox" name="Chk_All"
								onclick="checkAll('Chk_Num')" />
						</td>
						<td>
							会议名称
						</td>
						<td>
							会议地点
						</td>
						<td>
							会议起始时间
						</td>
						<td>
							会议终止时间
						</td>
						<td>
							发布时间
						</td>
						<td class="td_width45">
							详细信息
						</td>
						<td class="td_with45">
							删除
						</td>
					</tr>
				</tbody>
				<tbody class="PageChild_List_main" style="text-align: left">
					<!-- 会议通知列表开始 -->
					<s:if test="list!=null&&list.size!=0">
					<s:iterator value="list" var="item">
						<tr class='td_no_bord'>
							<td class="td_width25">
							<span title="24"><input id="Chk_Num" type="checkbox"
										name="ReptShow$ctl01$Chk_Num" value="${item.noticeId}" /> </span>
							</td>
							<td>
								<span>${item.title}&nbsp;</span>
							</td>
							<td>
								<span> ${item.place}&nbsp; </span>
							</td>
							<td>
								<s:date name="startTime" format="yyyy-MM-dd HH:mm" />&nbsp;
							</td>
							<td>
								<s:date name="endTime" format="yyyy-MM-dd HH:mm" />&nbsp;
							</td>
							<td>
								<s:date name="publishTime" format="yyyy-MM-dd HH:mm" />&nbsp;
							</td>
							<td>
								<a class="editButton ui-link-viewDetail-button"
									entityId="${item.noticeId}" id="sender_${item.noticeId}"
									href="javascript:void(0);" state="0"
									entityId="${item.noticeId}" onclick="return false;"> <img
										src="<%=basePath%>/themes/icons/info.png" title="单击查看详细会议信息" />
								</a> &nbsp;
							</td>
							<td>
								<a href="javascript:;"
									onclick='location="notice!delete.action?delete_id=${item.noticeId}&currpage=${currpage}";'><img
										src="<%=basePath%>/themes/icons/delete.png" title="单击删除会议信息"/> 
								</a> &nbsp;
							</td>
						</tr>
					</s:iterator>
					</s:if><s:else>
						<tr>
							<td colspan="8">无记录</td>
						</tr>
					</s:else>
					<!-- 会议通知列表结束 -->

				</tbody>
			</table>
			<div id="divTopPageNavi" class="list_r_title_text3">

				<!--分页导航开始-->
				<s:if test="currpage<=1">
					<span class='list_r_title_text3a'> <img
							src="<%=basePath%>/themes/images/default/page_up_gray.gif"></img>
					</span>

				</s:if>
				<s:else>
					<span class='list_r_title_text3a'> <a name="link_page_prev"
						id="link_page_prev" href="javascript:void(0);"
						currentPage="${currpage-1}"> <img
								src="<%=basePath%>/themes/images/default/page_up.gif"></img> </a> </span>
				</s:else>
				<span class='list_r_title_text3b'> 第${currpage
					}页/共${totalpage }页 </span>
				<s:if test="currpage>=totalpage">
					<span class='list_r_title_text3a'> <img
							src="<%=basePath%>/themes/images/default/page_down_gray.gif"></img>
					</span>
				</s:if>
				<s:else>
					<span class='list_r_title_text3a'> <a name="link_page_next"
						id="link_page_next" href="javascript:void(0);"
						currentPage="${currpage+1 }"> <img
								src="<%=basePath%>/themes/images/default/page_down.gif"></img> </a>
					</span>
				</s:else>
				<span id="goToPageTextArea"><input type="text"
						class="easyui-numberbox" id="goPageNum" max="${totalpage}" min="1" />
					<input type="button" id="turnToPageButton" value="GO" />
				</span>
				<!--分页导航结束-->
			</div>
			<div>
			<input type="button" name="btn_Delete" class="o-btn SubmitButton"
				value="删 除" id="btn_Delete"
				onclick="deleteAll('ReptShow$ctl01$Chk_Num')">
			</div>
		</div>

		<div id="dialog-form" title="通知详情" style="padding: 10px;">
		<table width="100%" border="0" cellspacing="0">
		<tr>
			<td class="mtd" width="100px;" style="height:26px">通知单内容:</td>
			<td valign="center" style=""><span style="height:26px" id="dialog-content"></span></td>
		</tr>
		<tr>
			<td class="mtd" width="100px;" style="height:26px">通知单附录:</td> 
			<td><span style="height:26px" id="dialog-postScript"></span></td>
		</tr>
		<tr>
			<td class="mtd" width="100px;" style="height:26px">与会部门 :</td>
			<td><span style="height:26px" id="dialog-sectionNames"></span></td>
		</tr>
		<tr>
			<td class="mtd" width="100px;" style="height:26px">与会人员:</td> 
			<td><span style="height:26px" id="dialog-staffNames"></span></td>
		</tr>
		</table>
		</div>
	</body>
</html>
